<%@ page import="swe.article.*"%>
<%@ page import="java.util.List"%>

<jsp:include page="layout/header.jsp" />

<script src='http://jquery-star-rating-plugin.googlecode.com/svn/trunk/jquery.js' type="text/javascript"></script>
<script src='http://jquery-star-rating-plugin.googlecode.com/svn/trunk/jquery.MetaData.js' type="text/javascript" language="javascript"></script>
<script src='http://jquery-star-rating-plugin.googlecode.com/svn/trunk/jquery.rating.js' type="text/javascript" language="javascript"></script>
<link href='http://jquery-star-rating-plugin.googlecode.com/svn/trunk/jquery.rating.css' type="text/css" rel="stylesheet"/>



<% if( (Boolean) session.getAttribute("isLoggedIn") == null) { 
	
	RequestDispatcher view = request.getRequestDispatcher("login.jsp");
	view.forward(request, response);
	
 } %>



<div class="row">
	<div class="span12">
<h2>Eingestellte Artikel</h2>
		<table class="table table-striped">
			<thead>
				<tr>
					<th>Bezeichnung</th>
					<th>Eingestellt am</th>
					<th>Endet am</th>
					<th>Typ</th>
					<th>Preis</th>
					<th>Status</th>
					<th>Bewertung<th>
				</tr>
			</thead>
			<tbody>
			<% 
        	if(request.getAttribute("articleList") != null) {
	        	List<Article> a = (List<Article>) request.getAttribute("articleList");
	        	for(int i = a.size(); i > 0; i--)   {	
	        		// Wenn user integriert, loeschen

      		%>
				<tr>
					<td><a href="Article?action=view&id=<%= a.get(i-1).getID() %>"><%= a.get(i-1).getTitle() %></a></td>
					<td><%= a.get(i-1).getCreatedHuman() %></td>
					<td><%= a.get(i-1).getEndDatetimeHuman() %></td>
					<td><% if(a.get(i-1).getIsAuction()) {  %> Auktion / <%= a.get(i-1).getBids().size() %> Gebote<% } else { %> Sofort-Kauf<% } %></td>
					<td><% if(a.get(i-1).getIsAuction()) {  %> <%= a.get(i-1).getHighestBid() %><% } else { %><%= a.get(i-1).getStartprice() %><% } %></td>
					<td><% if(a.get(i-1).isActive()) {  %> nicht verkauft<% } else { %> verkauft oder abgelaufen<% } %></td>
					<td>
						<% if(a.get(i-1).isRated()) { 
						
						Double tmprating = a.get(i-1).getRating().getRating();
						 %>
						 
						<%= tmprating%>
						
						
						
						<%
						/*
						String outtmp = "";
						
						
						for (int j=0;j<0;j++){ 
						
							outtmp += "<input name='star3' type='radio' class='star' disabled='disabled'";
							// if (j<=tmprating) { outtmp += " checked='checked'"; }
							outtmp += "/>";
						}
						out.println(outtmp);	
						*/
						%>

					
						
						<% } else {
						%> noch keine
						
						<% } %>
						
		<div class="Clear">

</div>

						

						
						
					</td>
				</tr>

			<% 
				}
        	} 
        	%>
			</tbody>
		</table>
	</div>
</div>






<jsp:include page="layout/footer.jsp" />
